-
Notifications
You must be signed in to change notification settings - Fork 7.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix GH-13727: Building with -Werror=strict-prototypes #14029
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many checks are at risk of being silently broken by -Werror
unfortunately.
The --enable-werror
switch adds -Werror
to CFLAGS after all checks have run, which avoids this problem.
Unfortunately users may add -Werror
manually and unknowingly break something. I don't know if we can do something about this. Maybe error out early if CFLAGS contain Werror? Or remove Werror during checks? Or remove Werror at the beginning of configure and re-add it at the end?
Compiler might have this enabled by default, so it won't be in the CFLAGS. This above example with CFLAGS is only to test it on compilers without this enabled. |
Do you know which compilers treat warnings as errors by default? To be clear I don't oppose the change, but I was wondering how we could handle this problem generally |
As far as I understand, Clang 16+ and GCC 14+ on future Fedora systems is one of these examples. Probably also on Gentoo. I have no list of these yet. 🤷 I just follow comments from other PRs in this case :D Also, from what I read is that when compiler will follow C standards more strictly, this will become an issue. But there's still enough time to fix these kind of syntax before this will be enabled. Probably @remicollet or @orlitzky might know more here. |
Do you mean new warnings, or treating them as error by default? |
Yes, not only warning, but errors: |
Thank you! |
Gentoo is rolling-release, source-based, and has crazy users. As soon as these new compilers are released, they'll be available, and someone will make it his default and try to rebuild his entire system with it. So +1 for fixing these issues before that guy files a bug about it. Thanks! |
This is addon to the phpGH-13727 bug fix. When configuring the build with: ./configure CFLAGS=-Werror=strict-prototypes libtool check for parsing nm command would fail: checking command to parse /usr/bin/nm -B output from cc object... failed Upstream libtool has this specific check already fixed. Note that this works only with Autoconf version 2.72 and later and is preparation for future compilers that might have this error enabled by default.
f6b40be
to
3a77a7f
Compare
This is addon to the GH-13727 bug fix that was fixed in GH-13732. When configuring the build with:
libtool check for parsing nm command would fail:
Upstream libtool has this specific check already fixed. Note that this works only with Autoconf version 2.72 and later and is preparation for future compilers that might have this error enabled by default.